package com.core.mapper;

import java.util.Set;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.common.model.entity.SysUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * @author zsh
 * @description 针对表【sys_user(系统用户表)】的数据库操作Mapper
 * @createDate 2025-10-18 22:43:01
 */
@Mapper
public interface SysUserMapper extends BaseMapper<SysUser> {
  /**
   * 根据用户名查询用户
   *
   * @param userName
   * @return
   */
  SysUser getUserByUserName(String userName);

  /**
   * 根据用户名查询用户角色
   *
   * @param userName
   * @return
   */
  Set<String> getUserRoleByUserName(@Param("userName") String userName);

  /**
   * 根据用户名查询用户权限
   *
   * @param username
   * @return
   */
  Set<String> getPermissionsByUsername(String username);

  long userRegister(SysUser sysUser);
}
